home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990: Night of the Living Disc / Night of the Living Disc.2mg / Dev.CD.5 / Apple.Software / Licensable.Code / FORMATTER / TECHNOTE < prev   
Encoding:
Text File  |  1985-11-16  |  4.6 KB  |  133 lines  |  [04] ASCII Text (0x0000)

  1.  
  2.  
  3.  
  4.  
  5.                             ProDOS TECHNICAL NOTE #5
  6.               ProDOS Block Device Preparation Routine (FORMATTER).
  7.                            (Revised October 24, 1985)
  8.  
  9.   Content of this note.
  10.   ---------------------
  11.   This technical note describes the FORMATTER routine that is available
  12.   through Apple's licensing department. The routine is supplied as a text file
  13.   of assembly source. It can be assembled with the ProDOS version of EdASM,
  14.   Apple's editor/assembler. This routine is a superset of the former FORMATTER
  15.   and BUILDDISK routines that were previously available through software
  16.   licensing. This routine will format and write out the necessary blocks to
  17.   support the ProDOS directory structure on any ProDOS block device.
  18.   Additionally it can be called to provide size and type information given a
  19.   ProDOS unit number.
  20.  
  21.   General Info.
  22.   -------------
  23.   There are two entry points to FORMATTER;
  24.  
  25.   ENTRY 1: (ORG + $10), will do all that is necessary to prepare the device
  26.   you specify for use with ProDOS. It will format the device if the device
  27.   supports formatting (including DISK II's). It will then proceed to write the
  28.   boot blocks, virgin directory, and bitmap, for any ProDOS device.
  29.  
  30.   ENTRY 2: (ORG + $13), will return the number of blocks on the specified
  31.   device. It will also return whether the device is a DISK II, the ProDOS /RAM
  32.   volume, or "other" type.
  33.  
  34.   Note :    Entry 2, does not do any writing to the device. It ONLY returns
  35.             size and type information.
  36.  
  37.   FORMATTER follows the guidelines in ProDOS Technical Note #16 to identify
  38.   ProDOS disk devices. Disk II's, are recognized by their signature bytes in
  39.   $CN00. The ProDOS /RAM disk is recognized by a driver address of $FF00. ROM
  40.   based devices are recognized by having their driver address in $CN00.
  41.   Anything else is considered a RAM based driver.
  42.  
  43.   Instructions for use.
  44.   ----------------------
  45.   ENTRY 1:
  46.   Upon entry at ENTRY 1 (ORG + $10), the accumulator must contain the DEVNUM.
  47.   DEVNUM in this case, is defined as containing zeros in the low nibble, and
  48.   the slot number in bits 4,5,6 and the hi-bit set to zero for drive 1 or set
  49.   to one for drive 2. Further X and Y must have the address of a 512 byte
  50.   buffer (X-lo, Y-hi), and DUMMYNAM and DUMSIZE must be filled in with the
  51.   desired volume name and name length if a name other than DEFAULT.NAME is
  52.   desired.
  53.  
  54.   NOTE: The volume name MUST be entered in UPPER case ASCII codes, with the
  55.         HI-BIT CLEAR.  IF ALL OF THE LETTERS IN THE VOLUME NAME ARE NOT IN
  56.         UPPERCASE, THEN ProDOS WILL NOT RECOGNIZE IT.  ProDOS itself always
  57.         upshifts the letters in the volume name before comparisons are done.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.   ENTRY 2:
  72.   Upon entry at ENTRY 2 (ORG + $13), the accumulator must contain the DEVNUM;
  73.   DEVNUM in this case, is defined as containing zeros in the low nibble, the
  74.   slot number in bits 4,5,6, and the hi-bit set to zero for drive 1 or set to
  75.   one for drive 2. Further X and Y must have the address of a 512 byte buffer
  76.   (X-lo, Y-hi).
  77.  
  78.   Exit Conditions
  79.   ---------------
  80.   ENTRY 1:
  81.   ENRTY 1 (ORG + $10) leaves zero-page intact, except for the bytes from $42
  82.   thru $47 which are defined for use when making requests to device drivers
  83.   and could be altered.
  84.  
  85.   If the process is successfull, the A-reg, will contain 0, and the carry flag
  86.   will be clear.
  87.  
  88.   ENTRY 2:
  89.   ENTRY 2 (ORG + $13), will leave zero page intact, except for locations
  90.   $42-$47, which are defined for use when making calls to device drivers, and
  91.   could be altered.
  92.  
  93.   If the process is successful, the carry flag will be clear, and the
  94.   X-register will contain the low byte of the number of blocks on the device,
  95.   the Y register will contain the high byte of the number of blocks on the
  96.   device, and the A register will contain;
  97.   - 0 if the unit is a DISK II.
  98.   - 1 if the unit is the ProDOS /RAM volume.
  99.   - 2 if the unit is of some other type.
  100.  
  101.  
  102.   In the cases of both ENTRY 1, and ENTRY 2:
  103.   If an error is detected, the X, and Y registers are undefined. The carry
  104.   flag will be set, and the standard ProDOS error codes that may be returned
  105.   in the A-Reg are: $27 - I/O Error, $28 - No device connected, $2B - Write
  106.   Protected, $33 - Drive too Slow, $34 - Drive too Fast.
  107.  
  108.   Memory usage.
  109.   -------------
  110.   FORMATTER is $C3A bytes Long, and may be assembled to run in any location in
  111.   main memory, between $800, and $B2C4
  112.  
  113.  
  114.                 APPLE COMPUTER, Inc., PCS Developer Technical Support
  115.                           20525 Mariani Avenue,  M/S 3T
  116.                             Cupertino, CA  95014
  117.                        Phone (408) 973-6411 or (408) 996-1010
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.